var personOffers = new Vue({

    el: "#personOffers",

    data: {
        //询价表
        offerTable: [],
        //横向菜单列表
        goodsType: [],
        //单个询价单信息
        offerTable_show: {},


    },
    //提交时间方法
    methods: {
        //查看报价详细信息
        showResult: function (id) {
            $.post("/home/quotation/selectByQuoteOrCompareId", {"id": id}, function (data) {
                $("#wrap-left").load("http://" + window.location.host + "/home/inquiryDetailsNew.html", function () {
                    debugger
                    inquiryDetails.priceQuote = data.data.QuotationList;
                });
            });

        },

        handleEdit: function (row) {
            debugger
            $.post("/home/quotation/selectByQuoteOrCompareId", {"id": row.id}, function (data) {
                $("#wrap-left").load("http://" + window.location.host + "/home/inquiryDetailsNew.html", function () {
                    debugger
                    inquiryDetails.priceQuote = data.data.QuotationList;
                });
            });
        },
        tableRowClassName:function(row, rowIndex) {
            var _this = this;
            if (rowIndex === 0) {
                return 'warning-row';
            }else if(rowIndex === 1) {
                return 'success-row';
            }else if (rowIndex==2) {
                return 'warning-row';
            }else if (rowIndex%2!=0) {
                return 'success-row';
            }else{
                return 'warning-row';
            }
            return '';
        },


        //跳转报价单页面
        FX_Board: function (quoteOrCompare) {
            $("#wrap-left").load("http://" + window.location.host + "/home/quotationperson.html", function () {

                quotation.quoteOrCompare.name = quoteOrCompare.commodityName + "*" + quoteOrCompare.commodityNum;
                quotation.quoteOrCompare.quoteOrCompareId = quoteOrCompare.id;
                quotation.quoteOrCompare.priceCap = quoteOrCompare.priceCap;
            });
        },





        //跳转询价单详情信息
        FX_Details: function (quoteOrCompare) {

            var _this = this;
            _this.offerTable_show = quoteOrCompare;
        }

    },






    //页面加载后的初始化方法
    created: function () {
        var _this = this;
        //获得菜单标签信息
        $.post("/home/quote_or_compare/selectAllByUserId_", "", function (data) {
            _this.offerTable = data.data.quoteOrCompare;
        });
    }
});
function tableRowClassName(row, rowIndex) {
    var _this = this;
    if (rowIndex === 1) {
        return 'warning-row';
    } else if (rowIndex === 3) {
        return 'success-row';
    }
    return '';
}